package com.huawei.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Department {

    private Long id;

    private String name;

    private String sn;

    // 将需要的数据转换后才能JSON字符串返回
    public String getJson(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        // 将map集合转换成Json字符串返回
        return JSON.toJSONString(map);
    }
}
